/**
 * 
 */
package cn.jhz.filesharingsystem.service;

import java.util.List;

import org.springframework.stereotype.Service;

import cn.jhz.filesharingsystem.dao.RoleDao;
import cn.jhz.filesharingsystem.model.Pager;
import cn.jhz.filesharingsystem.model.Role;

/**
 * @author asus
 *
 */
@Service("roleService")
public class RoleServiceImpl extends BaseServiceImpl<Role> implements RoleService {



	@Override
	public List<Role> getAllRoles(boolean state) {
		return ((RoleDao)baseDao).getAllRoles(state);
	}

	@Override
	public Pager<Role> getAllPagerRoles(boolean state) {
		return ((RoleDao)baseDao).getAllPagerRoles(state);
	}

	@Override
	public void updateState(Integer id) {
		Role role = baseDao.load(id);
		role.setState(role.getState()>0?0:1);
		baseDao.update(role);
	}

}
